\documentclass[smaller,red]{beamer}
\graphicspath{{img/}}
\usetheme{default}
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.9,0.9,0.9}
\lstset{
	backgroundcolor=\color{lbcolor},
	tabsize=4,
	rulecolor=,
	language=matlab,
        upquote=true,
        aboveskip={1\baselineskip},
        columns=fixed,
        showstringspaces=false,
        extendedchars=true,
        breaklines=true,
        prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
        frame=single,
        showtabs=false,
        showspaces=false,
        showstringspaces=false,
        identifierstyle=\ttfamily,
        keywordstyle=\color[rgb]{0,0,1},
        commentstyle=\color[rgb]{0.133,0.545,0.133},
        stringstyle=\color[rgb]{0.627,0.126,0.941},
}
\usepackage[center,small]{caption}
\usepackage{url,subfig,float,tabularx,multimedia}
\setbeamertemplate{footline}{
  \colorbox{red}{\color{white}
     \begin{tabularx}{0.98\textwidth}{ X X X }
          \includegraphics[height=0.3cm]{koc}& 
          \centering  \includegraphics[height=0.3cm]{flf} ~ECOE508, May, 2011& 
          \hfill\insertpagenumber/\inserttotalframenumber\\
      \end{tabularx}
}
}
\setbeamertemplate{navigation symbols}[vertical]
\renewcommand*{\figurename}{}

\title{LENS FOCAL LENGTH FINDER}
\author{Kaan Ak\c{s}it and M. K{\i}van\c{c} Hedili}
\institute{Ko\c{c} University, Optical Micro-systems Laboratory, Department of Electronic \& Electrical Engineering, Istanbul, Turkey
}
\date{ECOE508 Computer Vision, June, 2011}                   

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

\section*{Outline} 
\begin{frame}
  \frametitle{Outline}
  \tableofcontents
\end{frame}

\section{Introduction}
\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Introduction to used tools}
  \begin{block}{}
  \begin{itemize}
  \item<1-> All the tools used in this project are open-source.
  \item<1-> Used technologies: Python, Subversion, OpenCV and Google Code.
  \end{itemize}
  \begin{center}
  \resizebox{50mm}{!}{\includegraphics{python}}
  \resizebox{20mm}{!}{\includegraphics{opencv}}\\
  \resizebox{20mm}{!}{\includegraphics{svn}}
  \resizebox{30mm}{!}{\includegraphics{googlecode}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
  \end{block}
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Concept of Lens focal length finding with Image Processing}
  \begin{center}
  \resizebox{90mm}{!}{\includegraphics{setup}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Concept of Lens focal length finding with Image Processing}
  \begin{figure}[H]
  \centering
  \resizebox{80mm}{!}{\includegraphics{bench}}
  \caption{Photograph of the experiment bench.}
  \end{figure}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Concept of Lens focal length finding with Image Processing}
  Magnification:
  \begin{equation}
  \begin{split}
  M=-\frac{d_i}{d_o}=\frac{h_i}{h_o}
  \end{split}
  \end{equation}
  Thin lens formula:
  \begin{equation}
  \begin{split}
  \frac{1}{f}=\frac{1}{S_1}+\frac{1}{S_2}
  \end{split}
  \end{equation}
  \begin{center}
  \resizebox{50mm}{!}{\includegraphics{chromatic}}
  \resizebox{30mm}{!}{\includegraphics{geometric}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Approach explained}
  \begin{center}
  \resizebox{110mm}{!}{\includegraphics{kivanc1}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Approach explained}
  \begin{center}
  \resizebox{100mm}{!}{\includegraphics{kivanc2}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Introduction}
  \framesubtitle{Approach explained}
  \begin{center}
  \resizebox{80mm}{!}{\includegraphics{kivanc3}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}


\section{Algorithm}
\begin{frame}
  \frametitle{Algorithm}
  \framesubtitle{Important parts of the implementation}
  \small How to find the focal length?
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=59,lastline=63]{../src/ana.py}
  \small Gray scale conversion:
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=133,lastline=136]{../src/ana.py}
  \small Binary conversion:
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=91,lastline=100]{../src/ana.py}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \frametitle{Algorithm}
  \framesubtitle{Important parts of the implementation}
  \small Canny edge detection:
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=102,lastline=108]{../src/ana.py}
  \small Magnification ratio finder:
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=65,lastline=68]{../src/ana.py}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}



\begin{frame}
  \frametitle{Algorithm}
  \framesubtitle{Important parts of the implementation}
  \small Boundary detection:
  \tiny \lstset{language=Python,breaklines=true}
  \lstinputlisting[language=Python,firstline=70,lastline=89]{../src/ana.py}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\section{Images}
\begin{frame}
  \frametitle{Images}
  \framesubtitle{Unprocessed images}
  \begin{columns}[c]
  \column{1.5in}
  \begin{figure}[H]
  \centering
  \resizebox{40mm}{!}{\includegraphics{on}}
  \caption{Photograph without lens in place.}
  \end{figure}
  \column{1.5in}
  \begin{figure}[H]
  \centering
  \resizebox{40mm}{!}{\includegraphics{onmercek250mmxy}}
  \caption{Photograph with lens in place, focal length of lens is $250mm$ in both axis.}
  \end{figure}
  \end{columns}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\section{Results}
\begin{frame}
  \frametitle{Result}
  \framesubtitle{Sample outputs}
  \begin{center}
  \resizebox{30mm}{!}{\includegraphics{binary}}
  \resizebox{30mm}{!}{\includegraphics{edge}}
  \resizebox{30mm}{!}{\includegraphics{dots}}\\
  \end{center}
  \begin{center}
  Terminal outputs:
  \resizebox{90mm}{!}{\includegraphics{result}}
  \end{center}
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\section{Conclusion}
\begin{frame}
  \frametitle{Conclusion}
  \begin{itemize}
  \item<1-> The algorithm is able to determine the focal length of the single piece lenses.
  \item<1-> The code is light can run in any platform with a web-cam.
  \item<1-> Better camera leads to a better accuracy.
  \item<1-> The theory introduces error.
  \item<1-> The approach is applicable to system that contains multiple lenses.
  \end{itemize}  
  \tiny  flf on Google Code, \url{http://code.google.com/p/flf/}, 2011.
\end{frame}

\begin{frame}
  \begin{block}{}
    \begin{center}
      \resizebox{90mm}{!}{Thank you very much for paying attention, Questions?}
    \end{center}
  \end{block}
\end{frame}

\end{document}
